﻿/**********************************************************
 ●项目：Smartkernel
 ●公司：智能核心信息技术研发中心
 ●作者：曹艳白
 ●邮箱：caoyanbai@gmail.com
 ●创建：2008-08-10
**********************************************************/
using System.Security.Principal;

namespace Smartkernel.Security.Authentication
{
    /// <summary>
    /// 用户对象
    /// </summary>
    public class SmartPrincipal : IPrincipal
    {
        private IIdentity identity;
        /// <summary>
        /// 用户标识
        /// </summary>
        public IIdentity Identity
        {
            get 
            {
                return this.identity;
            }
        }
        /// <summary>
        /// 判断用户是否是指定的角色
        /// </summary>
        /// <param name="role">角色</param>
        /// <returns>判断的结果</returns>
        public bool IsInRole(string role)
        {
            return true;
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="identity">用户标识</param>
        public SmartPrincipal(IIdentity identity)
        {
            this.identity = identity;
        }
    }
}
